/**
 * @file
 * @description 用户模块接口文件
 */

import request from "./request";

/**
 * @methods
 * @description 登录
 * @param {Object} model 用户登录信息
 */
export const Logins = (model) => request.post("login",model)

/**
 * @method
 * @description 搜索
 * @param {Object} model  查询模型
 */

 export const search = (model) => request.get('users',{
    params:model
})
/**
 * @methods
 * @description 状态接口
 * @param {Number} id  用户ID
 * @param {Boolean} state 用户状态
 */
export const changestate = (id,state) => request.put(`users/${id}/state/${state}`)

/**
 * @methods
 * @description 添加接口
 * @param {Object} model  用户数据 
 */
export const addUsers = (model) => request.post('users',model)

/**
 * @methods
 * @descrition 删除用户
 * @param {Number} id  用户ID 
 */
export const delUsers = (id) => request.delete('users/'+id)
/**
 * @method
 * @description 修改用户
 * @param {Object} 用户数据 
 */

export const updataUsers = (model) => request.put(`users/${model.id}`,model)